import request from '@/utils/request'

const role_link="/admin/system/user";

export function index(page,limit,search) {
  return request({
    url: `${role_link}/${page}/${limit}`,
    method: 'post',
    data: search
  })
}

export function insertUser(data) {
  return request({
    url: `${role_link}/insertUser`,
    method: 'post',
    data: data
  })
}

export function updateUser(data) {
  return request({
    url: `${role_link}/updateUser`,
    method: 'post',
    data: data
  })
}

export function deleteUser(data) {
  return request({
    url: `${role_link}/deleteUser`,
    method: 'post',
    data: data
  })
}

export function getSign() {
  return request({
    url: `${role_link}/getSign`,
    method: 'get',
  })
}

export function getUserRole(data) {
  return request({
    url: `${role_link}/getUserRole`,
    method: 'post',
    data: data
  })
}

export function userGrant(userId,data) {
  return request({
    url: `${role_link}/userGrant/${userId}`,
    method: 'post',
    data: data
  })
}